/**
 * 日期处理类
 */
export const dayArr = ['日', '一', '二', '三', '四', '五', '六'];
export class DateUtil {
  static formatNum = (time: number) => {
    return (time < 10 ? '0' + time : time);
  }

  static formatCurrDate = () => {
    const date = new Date();
    const year = date.getFullYear();
    const month = date.getMonth() + 1;
    const day = date.getDay();
    return [year, month, day].map(DateUtil.formatNum).join('-');
  }

  static getWeek = () => {
    const date = new Date();
    const day = date.getDay();
    return `星期${dayArr[day]}`;
  }
}